Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Destroying Viewers

This section describes the routines you can use to create and destroy viewer objects. See "Creating a Viewer" for complete source code examples that illustrate how to use these routines.

Q3ViewerNew

You can use the Q3ViewerNew function to create a new viewer object.

MAC OS VERSION

TQ3ViewerObject Q3ViewerNew (
                     CGrafPtr         port,
                     Rect             *rect,
                     unsigned long    flags);

WINDOWS VERSION

TQ3ViewerObject Q3WinViewerNew (
                     HWND window,
                     const RECT *rect,
                     unsigned long flags );

PARAMETERS

port
A pointer to a color graphics port that specifies the window with which the new viewer is to be associated, or a pointer to an offscreen graphics world. You can also pass the value NULL in this parameter to create an empty viewer; you can associate a port with the empty viewer by calling the Q3ViewerSetPort function.
window
A window handle.
rect
The desired viewer pane for the new viewer object. This rectangle is specified in window coordinates, where the origin (0, 0) is the upper-left corner of the window and values increase to the right and down the window.
flags
A set of viewer flags.
return value
A viewer object.

DESCRIPTION

The Q3ViewerNew function returns, as its function result, a reference to a new viewer object that is to be drawn in the window specified by the port parameter, in the location specified by the rect parameter. The flags parameter specifies the desired set of viewer flags. See "Viewer Flags" for information on the flags you can specify when calling Q3ViewerNew .

The Q3ViewerNew function calls the QuickDraw 3D function Q3Initialize if your application has not already called it.

The object returned by Q3ViewerNew , of type TQ3ViewerObject , is not a general QuickDraw 3D object. Accordingly, you cannot call QuickDraw 3D object management functions, such as Q3Object_Dispose or Q3Object_Duplicate , on it. The type TQ3ViewerObject is used as a parameter type in other viewer routines, to refer to a viewer object.

Q3ViewerDispose

You can use the Q3ViewerDispose function to dispose of a viewer object.

MAC OS VERSION

OSErr Q3ViewerDispose (TQ3ViewerObject theViewer);

WINDOWS VERSION

TQ3Status Q3WinViewerDispose (TQ3ViewerObject viewer );

PARAMETER

theViewer
A viewer object.

DESCRIPTION

The Q3ViewerDispose function disposes of the viewer object specified by the theViewer parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |